package com.mszlu.blog.controller;


import com.mszlu.blog.service.TagService;
import com.mszlu.blog.admin.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("tags")
public class TagsController {


    @Autowired
    private TagService tagsService;

    // /tags/hot
    @GetMapping("hot")
    private Result hot(){
        int limit = 6;
        return tagsService.hots(limit);

    }
    @GetMapping
    private Result findAll(){
        return tagsService.findAll();
    }
    @GetMapping("detail")
    private Result findAllDetail(){
        return tagsService.findAllDetail();
    }
    @GetMapping("detail/{id}")
    private Result findDetailById(@PathVariable("id")Long id){

        return tagsService.findDetailById(id);

    }
}
